package com.jrh.dal;

import java.util.List;

import com.jrh.domain.entity.ImgAd;

/**
 * 图片广告
 * 
 * @author yout 2012-8-2 下午11:04:47
 */
public class ImgAdDao extends BaseDao<ImgAd> {

    /**
     * 
     */
    public ImgAdDao(){
        this.namespace = "jrh.single.imgAd";
    }

    @SuppressWarnings("unchecked")
    public List<ImgAd> listByCondition(ImgAd imgAd) {
        return (List<ImgAd>) sqlMapClientTemplate.queryForList(namespace + "." + "listByCondition", imgAd);
    }

    public int deleteByRef(Long refId, String refType) {
        ImgAd imgAd = new ImgAd();
        imgAd.setRefId(refId);
        imgAd.setRefType(refType);
        return sqlMapClientTemplate.delete(namespace + "." + "deleteByRef", imgAd);
    }
}
